﻿<phone:PhoneApplicationPage x:Class="KouDai.Phone.Views.NewSecondCategoryPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:vm="clr-namespace:KouDai.Phone.ViewModels"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            Orientation="Portrait"
                            SupportedOrientations="Portrait"
                            cal:Bind.AtDesignTime="True"
                            d:DataContext="{d:DesignInstance Type=vm:NewSecondCategoryPageViewModel,
                                                             IsDesignTimeCreatable=True}"
                            shell:SystemTray.IsVisible="True"
                            mc:Ignorable="d">

    <!--  LayoutRoot is the root grid where all page content is placed  -->
    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush ImageSource="/Images/kd_background.png" />
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--  TitlePanel contains the name of the application and page title  -->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Style="{StaticResource AppTitleTextBlockStyle}" />
            <TextBlock x:Name="Title"
                       Margin="9,-7,0,0"
                       Foreground="{StaticResource TextColorLightBrush}"
                       Style="{StaticResource PhoneTextTitle1Style}"
                       Text="女装" />
        </StackPanel>

        <!--  ContentPanel - place additional content here  -->
        <Grid x:Name="ContentPanel"
              Grid.Row="1"
              Margin="12,0,12,0">
            <phone:LongListSelector GridCellSize="105,140"
                                    HideEmptyGroups="True"
                                    IsGroupingEnabled="True"
                                    ItemsSource="{Binding Items}"
                                    LayoutMode="Grid">

                <phone:LongListSelector.GroupHeaderTemplate>
                    <DataTemplate>
                        <Grid Width="450">
                            <TextBlock HorizontalAlignment="Left"
                                       FontSize="48"
                                       Foreground="{StaticResource TextColorLightBrush}"
                                       Text="{Binding Title}"
                                       TextAlignment="Center" />
                        </Grid>
                    </DataTemplate>
                </phone:LongListSelector.GroupHeaderTemplate>
                <phone:LongListSelector.ItemTemplate>
                    <DataTemplate>
                        <Button Width="105"
                                Margin="3,5"
                                BorderThickness="0"
                                Padding="0"
                                Style="{StaticResource NoBorderNoThicknessButtonStyle}"
                                toolkit:TiltEffect.IsTiltEnabled="True">

                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <cal:ActionMessage MethodName="SelectCategory">
                                        <cal:Parameter Value="$dataContext" />
                                    </cal:ActionMessage>
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Image Source="{Binding ImageUrl}" Stretch="UniformToFill" />
                                <TextBlock Grid.Row="1"
                                           HorizontalAlignment="Center"
                                           FontSize="24"
                                           Foreground="{StaticResource HotListDarkBrush}"
                                           Text="{Binding ItemTagName}"
                                           TextWrapping="Wrap" />
                            </Grid>
                        </Button>
                    </DataTemplate>
                </phone:LongListSelector.ItemTemplate>
                <!--
                    <phone:LongListSelector.JumpListStyle>
                    <Style TargetType="phone:LongListSelector">
                    <Setter Property="Margin" Value="12,6,0,0" />
                    <Setter Property="ItemTemplate">
                    <Setter.Value>
                    <DataTemplate>
                    <Border Width="432"
                    Height="62"
                    Margin="6"
                    Background="{StaticResource ImageWallBackBrush}"
                    Padding="12,0,0,6"
                    toolkit:TiltEffect.IsTiltEnabled="True">
                    <TextBlock HorizontalAlignment="Left"
                    VerticalAlignment="Bottom"
                    FontSize="30"
                    Text="{Binding Title}" />
                    </Border>
                    </DataTemplate>
                    </Setter.Value>
                    </Setter>
                    </Style>
                    </phone:LongListSelector.JumpListStyle>
                -->
            </phone:LongListSelector>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>